package com.bdqn.business.access.dao;

import com.bdqn.entity.access.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface RoleRepository extends JpaRepository<Role,String> {

    @Query(nativeQuery = true,value = "SELECT r.* FROM pe_role r,pe_user u,pe_user_role ur WHERE u.id = ur.user_id AND ur.role_id = r.id AND u.id = ?")
    List<Role> getRoleListByUserId(String userId);
}
